package com.boxin.ims.modules.wechat.entity.share;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class RuleType {
	
	public final static Integer RULE_TYPE_EQUALS = 1;	//与之相等
	public final static Integer RULE_TYPE_CONTAINS = 2;	//包含 某些数字
	public final static Integer RULE_TYPE_ALL_SAME = 3; //都相同
	public final static Integer RULE_TYPE_EVEN = 4;	//偶数
	public final static Integer RULE_TYPE_ODD  = 5;	//奇数
	public final static Integer RULE_TYPE_HEADER =6;//开头数
	public final static Integer RULE_TYPE_TAIL = 7; //属数
	public final static Integer RULE_TYPE_FORMULA=8;//公式
	
	private Integer key ;
	private String value;
	
	public RuleType(Integer key,String value) {
		this.key = key;
		this.value = value;
	}
	
	
	public final static Map<Integer,String>  RULE_MAP = new HashMap<Integer,String>();
	public final static List<RuleType> ruleMapList = new ArrayList<RuleType>();
	
	
	static{
		RULE_MAP.put(RULE_TYPE_EQUALS, "完全等于");
		RULE_MAP.put(RULE_TYPE_CONTAINS, "包含");
		RULE_MAP.put(RULE_TYPE_ALL_SAME, "数字相同");
		RULE_MAP.put(RULE_TYPE_EVEN, "偶数");
		RULE_MAP.put(RULE_TYPE_ODD, "奇数");
		RULE_MAP.put(RULE_TYPE_HEADER, "开头等于");
		RULE_MAP.put(RULE_TYPE_TAIL, "尾数等于");
		RULE_MAP.put(RULE_TYPE_FORMULA, "数学公式");
		
		
		
		ruleMapList.add(new RuleType(RULE_TYPE_EQUALS, "完全等于"));
		ruleMapList.add(new RuleType(RULE_TYPE_CONTAINS, "包含"));
		ruleMapList.add(new RuleType(RULE_TYPE_ALL_SAME, "数字相同"));
		ruleMapList.add(new RuleType(RULE_TYPE_EVEN, "偶数"));
		ruleMapList.add(new RuleType(RULE_TYPE_ODD, "奇数"));
		ruleMapList.add(new RuleType(RULE_TYPE_HEADER, "开头等于"));
		ruleMapList.add(new RuleType(RULE_TYPE_TAIL, "尾数等于"));
		ruleMapList.add(new RuleType(RULE_TYPE_FORMULA, "数据公式"));
	}


	public Integer getKey() {
		return key;
	}


	public void setKey(Integer key) {
		this.key = key;
	}


	public String getValue() {
		return value;
	}


	public void setValue(String value) {
		this.value = value;
	}
	
	
	public static String getDisplayValueByKey(Integer key){
		return RULE_MAP.get(key);
	}
	
	
	
	
}
	

